# Maintainer: Dominic Sisneros <dsisnero@gmail.com>

_realname=lasem
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.4.3
pkgrel=1
pkgdesc="Lasem aims to be a C/Gobject based SVG/Mathml renderer (mingw-w64)"
arch=('any')
url="https://github.com/GNOME/lasem"
license=('LGPL')
license=('GPL' 'MPL' 'LGPL')
makedepends=("${MINGW_PACKAGE_PREFIX}-gobject-introspection"
             "${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2"
             "${MINGW_PACKAGE_PREFIX}-glib2"
             "${MINGW_PACKAGE_PREFIX}-gtk-doc"
             "${MINGW_PACKAGE_PREFIX}-cairo"
             "${MINGW_PACKAGE_PREFIX}-pango"
             "${MINGW_PACKAGE_PREFIX}-libxml2"
             "flex"
             "bison"
             "intltool"
            )

source=(${_realname}-${pkgver}.tar.gz::"https://github.com/GNOME/lasem/archive/LASEM_${pkgver//./_}.tar.gz")
sha256sums=('20506a874a718c141ee2870aebee6a1017bb951f4a52f7b8f13f4e497621e310')

build() {
  [[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST}
  cp -rf "${_realname}-LASEM_${pkgver//./_}" build-${MINGW_CHOST}
  cd build-${MINGW_CHOST}

  ./autogen.sh
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc
  
  make
}

# check() {
#  #   make check
# }



package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" -j1 install
}

